<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="https://cdn.staticfile.org/twitter-bootstrap/3.4.0/css/bootstrap.min.css" />
		<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div class="row col-md-6 col-md-offset-3">
			<div class="panel panel-success ">
				<div class="panel-heading">
					<h3 class="panel-title">登陆</h3>
				</div>
				<div class="panel-body">
					<form>
						<div class="form-group">
							<label for="exampleInputEmail1">账号</label>
							<input type="text" class="form-control" id="exampleInputEmail1" name="user" placeholder="identity">
						</div>
						<div class="form-group">
							<label for="exampleInputPassword1">密码</label>
							<input type="password" class="form-control" id="exampleInputPassword1" name="possword" placeholder="Password">
						</div>
					
						
						<button type="button" class="btn btn-default" id="button1" onclick="jk()"  key>登陆</button>
					</form>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			function jk(){
                $.post("login",$("form").serialize(),function(res){
                    if (res.code=="1"){
                        location.href="admin/read-book.html"
                    }else {
                        alert("密码错误")
                    }
                })
            }





            $("#exampleInputPassword1").bind('keydown', function (e) {
                if (e.keyCode==13){
                    jk()
				}
            })


			
		</script>
	</body>

</html>